package fachada;

import classes.Agenda;
import classes.CargoComissao;
import classes.CargoEfetivo;
import classes.Evento;
import classes.EventoParticipante;
import classes.Lotacao;
import classes.Servidor;
import classes.Tarefa;
import classes.TarefaAndamento;
import classes.TarefaServidor;
import controlador.AgendaControlador;
import controlador.CargoControlador;
import controlador.EventoControlador;
import controlador.LotacaoControlador;
import controlador.ServidorControlador;
import controlador.TarefaAndControlador;
import controlador.TarefaControlador;
import erro.ConexaoException;
import erro.ConsultaException;
import erro.GeralException;
import java.sql.SQLException;
import java.util.ArrayList;

/**
 *
 * @author Roberta
 */
public class Fachada {

    private TarefaControlador tarefaControl = null;
    private ServidorControlador RespControl = null;
    private EventoControlador eventoControl = null;
    private LotacaoControlador lotacaoControl = null;
    private CargoControlador cargoControl = null;
    private TarefaAndControlador andamentoControl = null;
    private AgendaControlador agendaControl = null;

    public Fachada() {
        this.tarefaControl = new TarefaControlador();
        this.RespControl = new ServidorControlador();
        this.eventoControl = new EventoControlador();
        this.lotacaoControl = new LotacaoControlador();
        this.cargoControl = new CargoControlador();
        this.andamentoControl = new TarefaAndControlador();
        this.agendaControl = new AgendaControlador();

    }
// .::TAREFA::. 

    /**
     * 
     * @param t (Tarefa)
     * @throws ConsultaException
     * @throws ConexaoException 
     */
    public void inserirTarefa(Tarefa t, TarefaServidor ts) throws ConexaoException, ConsultaException, GeralException {
        this.tarefaControl.inserirTarefa(t, ts);

    }

    /**
     * 
     * @param t (Tarefa)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listar(Tarefa t) throws ConexaoException, ConsultaException {
        return this.tarefaControl.listar(t);
    }

    /**
     * 
     * @param t (Tarefa)
     * @param ts (TarefaServidor)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletarTarefa(Tarefa t, TarefaServidor ts) throws ConexaoException, ConsultaException {
        this.tarefaControl.deletarTarefa(t, ts);
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<TarefaServidor> pesquisarTs() throws ConexaoException, ConsultaException {
        return (ArrayList<TarefaServidor>) this.tarefaControl.pesquisarTs();
    }

    /**
     * 
     * @param t (Tarefa)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Tarefa pesquisar(Tarefa t) throws ConexaoException, ConsultaException {
        return (Tarefa) this.tarefaControl.pesquisar(t);
    }

    /**
     * 
     * @param  (Tarefa)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Tarefa consultarid(Tarefa t) throws ConexaoException, ConsultaException {
        return (Tarefa) this.tarefaControl.consultarid(t);
    }

    /**
     * 
     * @param t (Tarefa)
     * @param ts (TarefaServidor)
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws GeralException 
     */
    public void alterarTarefa(Tarefa t, TarefaServidor ts) throws ConexaoException, ConsultaException, GeralException {
        this.tarefaControl.alterarTarefa(t, ts);
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarStatus() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarStatus();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarPorSolicitante() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarPorSolicitante();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarConcluidas() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarConcluidas();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarAtrasadas() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarAtrasadas();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarNaoIniciadas() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarNaoIniciadas();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarTodas() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarTodas();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarExcluidas() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarExcluidas();
    }

    /**
     * 
     * @param t (Tarefa)
     * @throws ConsultaException
     * @throws ConexaoException 
     */
    public void alterarStatus(Tarefa t) throws ConsultaException, ConexaoException {
        this.tarefaControl.alterarStatus(t);
    }

    /**
     * 
     * @param t (Tarefa)
     * @throws ConsultaException
     * @throws ConexaoException 
     */
    public void InserirDataInicial(Tarefa t) throws ConsultaException, ConexaoException {
        this.tarefaControl.InserirDataInicial(t);
    }

    /**
     * 
     * @param t (Tarefa)
     * @throws ConsultaException
     * @throws ConexaoException 
     */
    public void InserirDataConclusao(Tarefa t) throws ConsultaException, ConexaoException {
        this.tarefaControl.InserirDataConclusao(t);
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<TarefaServidor> listarTs() throws ConexaoException, ConsultaException {
        return (ArrayList<TarefaServidor>) this.tarefaControl.listarTs();
    }

    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Tarefa> listarRespansavel() throws ConexaoException, ConsultaException {
        return (ArrayList<Tarefa>) this.tarefaControl.listarParticipo();
    }

// .::TarefaAndamento::.
    /**
     * 
     * @param ta TarefaAndamento
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletarAnd(TarefaAndamento ta) throws ConexaoException, ConsultaException {
        this.andamentoControl.deletarAnd(ta);
    }

    /**
     * 
     * @param ta (TarefaAndamento)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletarAndamento(TarefaAndamento ta) throws ConexaoException, ConsultaException {
        this.andamentoControl.deletarAndamento(ta);
    }

    /**
     * 
     * @param ta (TarefaAndamento)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public TarefaAndamento pesquisar(TarefaAndamento ta) throws ConexaoException, ConsultaException {
        return (TarefaAndamento) this.andamentoControl.pesquisar(ta);
    }
    /**
     * 
     * @param ta (TarefaAndamento)
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws GeralException 
     */
    public void alterar(TarefaAndamento ta) throws ConexaoException, ConsultaException, GeralException {
        this.andamentoControl.alterar(ta);
    }
    /**
     * 
     * @param ta (TarefaAndamento)
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws GeralException
     * @throws GeralException 
     */
    public void inserir(TarefaAndamento ta) throws ConexaoException, ConsultaException, GeralException, GeralException {
        this.andamentoControl.inserir(ta);
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<TarefaAndamento> listar() throws ConexaoException, ConsultaException {
        return (ArrayList<TarefaAndamento>) this.andamentoControl.listar();
    }
// .::Servidor::.

    /**
     * 
     * @param s Servidor
     * @throws ConsultaException
     * @throws ConexaoException
     * @throws GeralException 
     */
    public void insert(Servidor s) throws ConsultaException, ConexaoException, GeralException {
        this.RespControl.insert(s);
    }
    /**
     * 
     * @param s (Servidor)
     * @throws ConsultaException
     * @throws ConexaoException
     * @throws GeralException
     * @throws SQLException 
     */
    public void delete(Servidor s) throws ConsultaException, ConexaoException, GeralException, SQLException {
        this.RespControl.delete(s);
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Servidor> listarDesabilitados() throws ConexaoException, ConsultaException {
        return (ArrayList<Servidor>) this.RespControl.listarDesabilitados();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Servidor> listarAtivos() throws ConexaoException, ConsultaException {
        return (ArrayList<Servidor>) this.RespControl.listarAtivos();
    }
    /**
     * 
     * @param s (Servidor)
     * @throws ConsultaException
     * @throws ConexaoException
     * @throws GeralException 
     */
    public void alterar(Servidor s) throws ConsultaException, ConexaoException, GeralException {
        this.RespControl.alterar(s);

    }
    /**
     * 
     * @param s (Servidor)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Servidor> listar(Servidor s) throws ConexaoException, ConsultaException {
        return this.RespControl.listar(s);
    }
    /**
     * 
     * @param s (Servidor)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Servidor pesquisar(Servidor s) throws ConexaoException, ConsultaException {
        return (Servidor) this.RespControl.pesquisar(s);
    }
    public Servidor pesquisarMatricula(Servidor s) throws ConsultaException, ConexaoException {
        return (Servidor) this.RespControl.pesquisarMatricula(s);
    }
    /**
     * 
     * @param s (Servidor)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Servidor pesquisarLogin(Servidor s) throws ConexaoException, ConsultaException {
        return (Servidor) this.RespControl.pesquisarLogin(s);
    }
    /**
     * 
     * @param s (Servidor)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void criarSenha(Servidor s) throws ConexaoException, ConsultaException {
        this.RespControl.criarSenha(s);
    }
    // .::Evento::.

    /**
     * 
     * @param e Evento
     * @throws ConsultaException
     * @throws ConexaoException
     * @throws GeralException
     * @throws SQLException 
     */
    public void inserirEvento(Evento e, EventoParticipante ep) throws ConexaoException, ConsultaException, GeralException {
        this.eventoControl.inserirEvento(e, ep);
    }
    /**
     * 
     * @param e (Evento)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Evento pesquisar(Evento e) throws ConexaoException, ConsultaException {
        return (Evento) this.eventoControl.pesquisar(e);
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Evento> listarParticipo() throws ConexaoException, ConsultaException {
        return (ArrayList<Evento>) this.eventoControl.listarParticipo();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Evento> listarLogado() throws ConexaoException, ConsultaException {
        return (ArrayList<Evento>) this.eventoControl.listarLogado();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Evento> listarAbertos() throws ConexaoException, ConsultaException {
        return (ArrayList<Evento>) this.eventoControl.listarAbertos();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Evento> listarEncerrados() throws ConexaoException, ConsultaException {
        return (ArrayList<Evento>) this.eventoControl.listarEncerrados();
    }
    /**
     * 
     * @param e (Evento)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Evento consultarid(Evento e) throws ConexaoException, ConsultaException {
        return (Evento) this.eventoControl.consultarid(e);
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Evento> listarEvento() throws ConexaoException, ConsultaException {
        return (ArrayList<Evento>) this.eventoControl.listar();
    }
    /**
     * 
     * @param e (Evento)
     * @param ep (EventoParticipante)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletarEvento(Evento e, EventoParticipante ep) throws ConexaoException, ConsultaException {
        this.eventoControl.deletarEvento(e, ep);
    }
    /**
     * 
     * @param e (Evento)
     * @param ep (EventoParticipante)
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws GeralException 
     */
    public void alterarEvento(Evento e, EventoParticipante ep) throws ConexaoException, ConsultaException, GeralException {
        this.eventoControl.alterarEvento(e, ep);
    }

    /**
     * 
     * @param ep EventoParticipante
     * @throws ConsultaException
     * @throws ConexaoException
     * @throws GeralException
     * @throws SQLException 
     */
    public ArrayList<EventoParticipante> listarP() throws ConexaoException, ConsultaException {
        return (ArrayList<EventoParticipante>) this.eventoControl.listarP();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<EventoParticipante> listarEP() throws ConexaoException, ConsultaException {
        return (ArrayList<EventoParticipante>) this.eventoControl.listarEP();
    }

// .::Lotacao::.
    /**
     * 
     * @param l Lotacao
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws SQLException 
     */
    public void inserir(Lotacao l) throws ConexaoException, ConsultaException {
        this.lotacaoControl.inserir(l);
    }
    /**
     * 
     * @param l (Lotacao)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void alterarLot(Lotacao l) throws ConexaoException, ConsultaException {
        this.lotacaoControl.alterarLot(l);
    }
    /**
     * 
     * @param l (Lotacao)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletar(Lotacao l) throws ConexaoException, ConsultaException {
        this.lotacaoControl.deletar(l);
    }
    /**
     * 
     * @param l (Lotacao)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Lotacao> listar(Lotacao l) throws ConexaoException, ConsultaException {
        return this.lotacaoControl.listar(l);
    }
    /**
     * 
     * @param l (Lotacao)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Lotacao pesquisar(Lotacao l) throws ConexaoException, ConsultaException {
        return (Lotacao) this.lotacaoControl.pesquisar(l);
    }

// .::CargoEfetivo::.
    /**
     * 
     * @param ce CargoEfetivo
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void inserir(CargoEfetivo ce) throws ConexaoException, ConsultaException {
        this.cargoControl.inserir(ce);
    }
    /**
     * 
     * @param ce (CargoEfetivo)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public CargoEfetivo pesquisar(CargoEfetivo ce) throws ConexaoException, ConsultaException {
        return (CargoEfetivo) this.cargoControl.pesquisar(ce);
    }
    /**
     * 
     * @param ce (CargoEfetivo)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<CargoEfetivo> listar(CargoEfetivo ce) throws ConexaoException, ConsultaException {
        return (ArrayList<CargoEfetivo>) this.cargoControl.listarCE(ce);
    }
    /**
     * 
     * @param ce (CargoEfetivo)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void alterarCe(CargoEfetivo ce) throws ConexaoException, ConsultaException {
        this.cargoControl.alterarCe(ce);
    }
    /**
     * 
     * @param ce (CargoEfetivo)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletar(CargoEfetivo ce) throws ConexaoException, ConsultaException {
        this.cargoControl.deletar(ce);
    }
// .::CargoComissao::.

    /**
     * 
     * @param cc CargoComissao
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void inserir(CargoComissao cc) throws ConexaoException, ConsultaException {
        this.cargoControl.inserir(cc);
    }
    /**
     * 
     * @param cc (CargoComissao cc)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void alterarCc(CargoComissao cc) throws ConexaoException, ConsultaException {
        this.cargoControl.alterarCc(cc);
    }
    /**
     * 
     * @param cc (CargoComissao cc)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<CargoComissao> listar(CargoComissao cc) throws ConexaoException, ConsultaException {
        return (ArrayList<CargoComissao>) this.cargoControl.listarCC(cc);
    }
    /**
     * 
     * @param cc (CargoComissao cc)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public CargoComissao pesquisar(CargoComissao cc) throws ConexaoException, ConsultaException {
        return (CargoComissao) this.cargoControl.pesquisar(cc);
    }
    /**
     * 
     * @param cc (CargoComissao cc)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletar(CargoComissao cc) throws ConexaoException, ConsultaException {
        this.cargoControl.deletar(cc);
    }
    //.::Agenda::.
    /**
     * 
     * @param a (Agenda)
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws GeralException 
     */
    public void inserirAgenda(Agenda a) throws ConexaoException, ConsultaException, GeralException {
        this.agendaControl.inserirAgenda(a);
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Agenda> listarAgenda() throws ConexaoException, ConsultaException {
        return (ArrayList<Agenda>) this.agendaControl.listar();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Agenda> listarFinalizados() throws ConexaoException, ConsultaException {
        return (ArrayList<Agenda>) this.agendaControl.listarFinalizados();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Agenda> listarLogadoAgenda() throws ConexaoException, ConsultaException {
        return (ArrayList<Agenda>) this.agendaControl.listarLogado();
    }
    /**
     * 
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public ArrayList<Agenda> listarAbertas() throws ConexaoException, ConsultaException {
        return (ArrayList<Agenda>) this.agendaControl.listarAbertas();
    }
    /**
     * 
     * @param a (Agenda)
     * @return
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public Agenda pesquisar(Agenda a) throws ConexaoException, ConsultaException {
        return (Agenda) this.agendaControl.pesquisar(a);
    }
    /**
     * 
     * @param a (Agenda)
     * @throws ConexaoException
     * @throws ConsultaException 
     */
    public void deletar(Agenda a) throws ConexaoException, ConsultaException {
        this.agendaControl.deletar(a);
    }
    /**
     * 
     * @param a(Agenda)
     * @throws ConexaoException
     * @throws ConsultaException
     * @throws GeralException 
     */
    public void alterar(Agenda a) throws ConexaoException, ConsultaException, GeralException {
        this.agendaControl.alterar(a);
    }
}
